perm filename INFO.TXT[IP,SYS] blob
sn#698348 filedate 1983-02-01 generic text, type C, neo UTF8
COMMENT ā VALID 00008 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 Notes on the TOPS-10 implementation of IP/TCP and conversion to WAITS.
C00004 00003 TOPS-10 notes.
C00006 00004 Undefined globals when trying to load TOPS-10 IMP code.
C00017 00005 Analysis of the TOPS-10 code.
C00019 00006 Entry points and internal symbols.
C00031 00007 Data structures.
C00035 00008 Potential problems.
C00038 ENDMK
Cā;
Notes on the TOPS-10 implementation of IP/TCP and conversion to WAITS.
Files (on [IP,SYS] at SAIL):
COMDEV.MAC Monitor device-dependent code, symbols, and data.
F.MAC Sets "feature" switches for TOPS-10 system.
FTPSRV.MAC FTP server for IP/TCP. (Comment by Provan: Doesn't work at
the moment because it tries to treate the IMP as a device,
but in the new monitor, the FTPSRV connection is just a
TTY and should be treated that way.)
IMP.MAC IMP system symbol definitions.
IMPCOM.MAC IMP Command handler. (Provan: corrected for absense of ICP.
Seems to work.)
IMPHLP.MAC Text for HELP command in IMPCOM.
IMPSER.MAC IMP interrupt service, input and output UUOs handlers,
TTY routines (for telnet connections), host table handling.
IMPSUB.MAC User subroutines for host table management, ICPs, and IMP
error handling.
IPSER.MAC IP service.
MACTEN.MAC Macros and symbols for TOPS-10 style coding.
MAIL.MAC The MAIL program.
NETCON.MAC Network Control Program (NCP).
NETDEF.MAC Common definitions for network code.
NETSUB.MAC Common subroutines.
S.MAC System parameter file for TOPS-10.
TULIP.MAC Tulip. (Whatever that is. Gets searched by several files.)
TCPSER.MAC TCP service, IMPUUO handler.
TOPS-10 notes.
The MONGEN program is apparently used to create several parameter files to
construct a TOPS-10 system. MONGEN asks you questions, and based on the answers
it inserts symbol definitions into the files
HDWCNF.MAC to define hardware configuration
TTYCNF.MAC to define terminal configuration
NETCNF.MAC to define network configuration
F.MAC to define software features
These are then read by other files. Amazingly enough, MONGEN compiles and runs
on WAITS. The file MONGEN.LOG is the result of trying this, producing output
on HDWCNF.WTS, TTYCNF.WTS, NETCNF.WTS, and F.WTS. It didn't seem completely
successful (especially in the case of F) but it did locate some of the undefined
symbols.
The file NETPRM is SEARCHed by some of the code; we still don't have it in
either [IP,SYS] or [T10,SYS].
Undefined globals when trying to load TOPS-10 IMP code.
The symbols on this page were undefined as a result of:
LOAD/link netdef,impser,ipser,tcpser,netsub
A location in parentheses after a symbol indicates where it is defined. A
location in brackets is a reference to one of these symbols; there may also be
others. Page numbers may often be off by 1, as a result of E directories and
the files on [IP,SYS] being different from the listings printed on 19-Dec-82.
.C0PC 401675 ;job's PC [IMPSER/61P]
.CPCPN 401174 ;some CPU number [IMPSER/46P]
* .CPJOB 406252
.CPSK0 401626
* ADRERR 406173 ; [TCPSER/47P]
ADVBFE 401522 ;advance buffer [IMPSER/58P]
ADVBFF 401444 ;advance buffers [IMPSER/56P]
* ASSASG 406627 (UUOCON/180P) ;assign a device [TCPSER/66P]
CCTYO9 402555 ; [IMPSER/82P]
CLRACT 406335 (UUOCON/209P) ;clear IOACT and return [IMPSER/62P]
CPOPJ 407574 (COMMON) ;return
CPOPJ1 407637 (COMMON) ;skip return
CPOPJ2 401744 (COMMON) ;skip 2 return
DDBLDB 406356 (SCNSER/23P) ;ptr to TTY LDB in TTY DDB [TCPSER/56P]
DEVSRG 406611 (UUOCON/189P) ;search for a device [TCPSER/66P]
DEYCPF 401173 (COMMON) ;ptr to CPU number somewhere [IMPSER/46P]
* DIE 407570 ;see S.MAC/109P
FPOPJ 402560 (COMMON) ;POP P,F and return (F=4)
GET4WD 407527 (CORE1/17P) ;gets a 4-word FS block [NETSUB/23P]
* GETWD1 406527 ;gets a word from a user buffer [TCPSER/52P]
* GETWDU 406645 ;gets a word from a user buffer [TCPSER/50P]
GIV4WD 407620 (CORE1/18P) ;release 4-word FS block [NETSUB/25P]
HDSITE 0 (COMDEV/78P)
HNGSTP 401545 ;type user message and stop [IMPSER/59P]
IADRCK 406216 (UUOCON/174P) ;address check [TCPSER/43P]
IMPBFE 407332 (COMDEV/78P)
IMPBFN 401260 (COMDEV/78P)
IMPBFS 407352 (COMDEV/78P)
IMPBFT 407347 (COMDEV/78P)
IMPBUF 407353 (COMDEV/78P)
IMPCHK 401050 ;check IMP hardware (skip 2 if OK, etc.) [IMPSER/14P]
IMPDWN 401243 ;turn IMP off [IMPSER/49P]
IMPIOF 400052 ;turn off input [IMPSER/12P]
IMPION 401142 ;turn on input (?) [IMPSER/12P]
IMPM36 407260 (COMDEV/78P)
IMPN 407622 (HDWCNF) ;number of connections to the Arpanet [COMDEV/78P]
IMPOUT 400503
IMPRQF 402203 (COMDEV/78P)
IOSNEC 402704 ; [IMPSER/80P]
ITIMPL 406574 (COMDEV/78P)
ITMCNT 401465 ;get byte count [IMPSER/54P]
* ITYFST 406575 ;offset from ITY # to line # [IMPSER/93P]
ITYN 0 (HDWCNF) ;number of IMP-crosspatched TTYs [COMDEV/78P]
ITYOFS 406310 (COMDEV/78P)
ITYTAB 403132 ;pseudo teletype 'ITY' linkage tale
JBTLCL 401652 ; [IMPSER/59P]
JIFSEC 405521 ; [NETSUB/23P]
JOBPD1 401636 ; [IMPSER/61P]
LDBDCH 403112 ;TTY characteristics [IMPSER/64P]
LDBDDB 403127 ;TTY DDB pointer [IMPSER/80P]
LDBIMP 406311 (SCNSER/12P) ;pointer from LDB to IMP DDB [IMPSER/65P]
LDLLCP 402703 ;flag bit for local copy line [IMPSER/80P]
LDPLNO 406321 (SCNSER/20P) ;ptr to hardware line number [IMPSER/65P]
LDPQTB 406353 (SCNSER/22P) ;table of pointers [TCPSER/56P]
LDPRTC 402407 ;ptr to RTCOMP bit [IMPSER/78P]
LDRIMP 402454 ;flag bit for IMP line [IMPSER/80P]
LDROSU 403111 ; [IMPSER/66P]
LINTAB 406303 (COMDEV/20P) ; [IMPSER/93P]
LOKSCI 407467 (COMMON/200P) ;see S.MAC/126P
LOKSPI 407526 (COMMON/200P) ;see S.MAC/103P
MIMBS1 400115 (COMDEV/78P)
MIMBS2 400044 (COMDEV/78P)
MITYN 403117 (COMDEV/78P)
* MNQUPT 406360 ;# of quote ptrs for TTY control [TCPSER/56P]
MYSITE 403245 (COMDEV/78P)
ONPOPJ 407530 ;turns PIs on and returns [TCPSER/30P]
OUT 401270
PBUFSZ 401655 (COMMON) ;ptr to some buffer size [IMPSER/61P]
PDVTIM 406326 (COMMON) ;set timeout in DDB
PJOBN 407461 (COMMON) ;ptr to job number [NETSUB/20P]
PRVBIT 406057
PRVJ 406457
PSIIOD 401665 ;signal input done [IMPSER/17P]
* PUTWD1 406602 ;puts a word in a user buffer [TCPSER/50P]
* PUTWDU 406653 ;puts a word in a user buffer [TCPSER/48P]
* PUTWRD 406172 ; [TCPSER/47P]
QUOCHK 406351 (SCNSER/193P) ;check a quote/escape character [TCPSER/56P]
RECIMP 402650 ; [IMPSER/71P]
REGSIZ 401275 ; [IMPSER/53P]
RELEA6 407513 (UUOCON/164P) ;releases a device [NETSUB/22P]
SAVE1 407564 (COMMON) ;saves register P1 (14)
SAVE2 407621 (COMMON) ;saves registers P1-P2 (14-15)
SAVE3 403442 (COMMON) ;saves registers P1-P3 (14-16)
SAVE4 406035 (COMMON) ;saves registers P1-P4 (14-17)
SAVT 407603 (COMMON) ;saves registers T1-T4 (6-11)
* SCNPIF 0 ;see S.MAC/126P
* SCNPIN 0 ;see S.MAC/126P
SETACT 406330 (UUOCON/209P) ;set IOACT [IMPSER/60P]
SETBYT 401460 ;set byte size [IMPSER/54P]
SETDVL 406651 (UUOCON/184P) ;store job # and add to logical table [IMPSER/65P]
SETECH 402720 ;enable user TELNET echoing [IMPSER/80P]
SETNEC 402712 ;disable user TELNET echoing [IMPSER/80P]
SONPJ1 406230 (SCNSER) ;SCNSER interrupts on and skip return
SONPPJ 406033 (SCNSER) ;SCNSER interrupts on and return
STIIOD 401711
SYSUPT 405533 ;current system uptime [IMPSER/32P]
T2POJ1 407167 (COMMON) ;POP P,T2 then CPOPJ1 (T2=7)
T2POPJ 407255 (COMMON) ;POP P,T2 and return (T2=7)
THSITE 0 (COMDEV/78P)
TICSEC 407561 ;number of ticks per second [NETSUB/10P]
TIME 407251 (COMMON/100P) ;time in ticks since midnight [NETSUB/10P]
TOTAKE 402305 ; [IMPSER/74P]
TPOPJ 407403 (COMMON) ;POP P,T1 and return (T1=6)
TPOPJ1 407563 (COMMON) ;POP P,T1 then CPOPJ1
TSETBI 404725 (SCNSER/104P) ;clears corresponding input buffer
TSETBO 404726 (SCNSER/104P) ;clears some output buffer [TCPSER/12P]
TTFCXF 0 (SCNSER/156P) ;name of FTP server [TCPSER/13P]
TTFCXG 0 (SCNSER/156P) ;name of finger server [TCPSER/13P]
TTFCXH 0 (SCNSER/156P) ;name of Telnet server [TCPSER/13P]
TTFORC 404733 (SCNSER/69P) ;forces a TTY command [TCPSER/12P]
TTPLEN 406301 ;# of TTY lines? [TCPSER/52P]
TTYFLT 0 ; [IMPSER/61P]
TTYIMP 401751 ;give SCNSER the IMP DDB [IMPSER/65P]
TTYOFF 403153 ;signal disconnect [IMPSER/94P]
TTYTAB 406355 (COMMON/75P) ;same as WAITS
TTYTTI 402017 (SCNSER) ;get a character [IMPSER/66P]
TTYXMT 402113
UNLSCI 407507 (COMMON/200P)
UNLSPI 407531 (COMMON/200P)
UNLSPT 0 (COMMON/200P)
UPOPJ 403134 (COMMON) ;POP P,U and return (U=5)
* WSYNC 406333 (CLOCK1) ;wait [IMPSER/60P]
XMTCHR 402310 ;get a char to send [IMPSER/74P]
XMTIMP 402274 ;code in SCNSER to simulate interrupt [IMPSER/74P]
ZRNGE 401660 ;some kind of range check [IMPSER/61P]
Most effort has been made to locate those symbols referenced from IPSER and TCPSER.
Some of those not yet identified are called from routines in IMPSER that we may not
use anyway.
Of those globals referenced in IPSER and TCPSER, the ones marked with a * above
have not had their definitions located yet.
Analysis of the TOPS-10 code.
** IMP input
A. At interrupt level.
1. [IMPSER, p. 12-16] Message is transferred into one or more buffers
(allocated as needed). Non-data messages are handled appropriately,
otherwise, if the link number indicates an IP packet, IPIN is called.
Non-IP data messages are ignored.
2. [IPSER, p. 7-9] Message is checksummed, etc. IP options are handled
and message fragments put together. Then the appropriate routine is
called depending on the protocol (ICMPIN or TCPIN).
3. [TCPSER, p. 9- ] Checksums TCP message, handles options. Then
processes messages in the "future queue" which have already come in
and can now be processed. Sends ACKs when necessary. The main work
is finding the DDB for the connection and linking the data to the
input stream for this DDB. If this connection in hooked up to an ITY
(an IMP-crosspatched TTY), then the appropriate TTY service routines
are called (some code in IMPSER).
B. At UUO level.
1. [IMPSER, p. 53-55] Transfers data from IMP buffers to user input buffers.
Calls several TCPSER routines to update information.
** IMP output
(not looked at yet)
Entry points and internal symbols.
[* = code, D = data]
IPSER:
* IPIN - handle an incoming IP message.
D IPADDR - our site number.
* IPMAKE - get a fresh buffer and put an IP leader (in 32 bit format) into
it. then link the buffer to the beginning of the current output
stream. then send this message down to 1822 level (IMPSER) to get it
fired off.
* IPSEC - once a second code for IP. it checks for time outs in the
fragmentation reassembly chain.
* SNDNSP - send a message to the sender of the current message saying
"no such port".
TCPSER:
* FLSFMB - routine to delete an FMB chain.
* IMPUUO - provides ability for the user to initiate IMP connections
under program control.
* SETURG - set up TCP data to send an URG message next time out.
* TCPCHK - subroutine to do various once a second checks to an IMP DDB.
* TCPICK - check a connection to see if it is in a state where input is legal.
* TCPIFN - check to see if this input stream has received a legitimate
FIN. called after data is exhausted to see if there's any more data
coming or if this is EOF. if we have received a FIN for this
connection, close it now.
* TCPIN - process incoming TCP message.
* TCPMAK - put TCP leader (in 32 bit format) into fixed TCP output leader
buffer. then link the buffer to the beginning of the current output
stream. then send the message down to the next level of protocol for
further processing.
* TCPOCK - check a connection to see if it is in a state where output
is legal.
* TCPWUP - update a window if the user has read some of the data waiting.
IMPSER:
* ALCNEW - subroutine to handle wake up after allocation has increased.
D DEVxxx - fields in IMPDDB (xxx one of: NAM, CHR, IOS, SER, MOD, LOG,
BUF, IAD, OAD, STS, STA, XTR, EVM, PSI, ESE, HCW, CPU, JOB, CTR)
* FIXRTQ - routine to take the host in T1 and make all entries in the
retransmission queue use that host.
* GO1822 - subroutine to check to see that a host is good and, if so,
send the message.
D IBFHLT - -1 if buffer still needed
* IMPAIO - routine called at clock level to continue processing
non-blocking IMP output.
* IMPATT - routine to set the job number into the right IMP DDB when
initiating a job from an IMP TTY or when an IMP TTY attaches to an
existing job.
D IMPDDB - prototype IMP DDB
* IMPDEV - subroutine to determine if a DDB is that of an IMP and whether
or not it is controlling a job through an ITY.
* IMPDSP - dispatch table
* IMPEIM - here at interrupt level upon receipt of the end of a message.
* IMPEOM - here at interrupt level when end-of-message has been sent.
* IMPIN - here at interrupt level on first input interrupt
* IMPIND - here on blki runout at interrupt level.
* IMPISR - table of interrupt service routines
* IMPMAK - prepare a message for output to the IMP by converting it to 36
bit buffers from 32 bit buffers and adding the 1822 leader to it.
after it's all ready, we put it in the queues for transmission and
retransmission if necessary.
* IMPNEW - subroutine to tell the input code about new data.
* IMPOND - here on blko runout at interrupt level.
* IMPRES - routine to clean up all IMP DDBs (clear IOS flags, etc.)
assigned to this job.
* IMPSEC - here every second to check things
* IMPTIK - routine called by CLOCK1 on any clock tick during which IMPRQF
is set, to perform requested IMP processing.
* IMPTTY - subroutine to set up a crosspatch between an IMP DDB and a local
teletype.
* IMPUP - -1 if want the IMP system up
* IMPW60, IMPWAT - routine to wait for interrupt activity.
* IMPWAK - routine to wake the job at interrupt level
* IMPWK1 - routine to clear all wait flags and reset the timeout counter
to infinity
* INBYTE - get the next byte from the given DDB's input byte stream.
* INON - here from NETSUB when a buffer is again free.
* ITYGET - subroutine to allocate a line number for IMPs connecting
to a local process.
* ITYREL - subroutine to release an ITY.
* ITYSTO - here from clock tick level to start processing queued output
to ITY's.
* MICIMP - see if crosspatched line can take more
* OKFLAG - -1 if IMP is useable
* OUTGO1 - subroutine to start up output
* RQIITI, RQIITO, RQTIIO, RQTOIO - routines to request IMP processing
at clock level.
* SNDMSG - subroutine to queue a TCP message for output from interrupt level.
D STOPFL - -1 if IMP going down
D TELTAB - this is the mapping table from TTY chars to telnet commands,
used by NETQUO in SCNSER.
* TTIDET - routine to detach a crosspatched TTY from its controlled IMP DDB.
* TTYTST - subroutine to test for a teletype connection.
* TTYURG - subroutine to appropriately tweak everybody when an URG comes in
through TCP.
* XMTQIT - routine called by SCNSER transmit interrupt code for an IMP line
when there are no more characters to transmit (i.e. the line becomes
'idle').
NETSUB:
* BIBCHK - BIB consistency check
* BUFGET - subroutine to allocate a buffer.
* BUFREL - subroutine to release a buffer.
* CLRIMP - subroutine to wipe a DDB.
* CSMBYT - deal with a single byte for checksumming purposes.
* CSMHWD - deal with a 16 bit byte for checksumming purposes.
* CSMWDS - deal with 32 bit words for checksumming purposes.
* CSMWRD - deal with a 32 bit word for checksumming purposes.
* DDBDEA - subroutine to release a DDB.
* DDBFLS - flush all data from a DDB.
* DDBGET - finds a DDB for this job.
* DDBREL - subroutine to release a DDB.
* FLSBIB - flush a stream of BIBs link through their retransmission
queue links.
* FNDDDB - scan through all the IMP DDBs to find one that matches
the given values.
* GETLED - copies a leader into a preassigned storage location.
* GETMES - pull in a message stream from IMP input, tacking it on to the
end of a possibly nonexistent stream.
* MAKBIB - make a buffer information block for the current output buffer.
* MILTIM - return milliseconds since midnight
* NXTBYT - subroutine to read the next byte from a data stream.
* NXTFLS - skip over bytes in the data stream described by P1, P2, and P3.
* NXTWRD - read in a full 32-bit word from the data stream described by
P1, P2, and P3.
* OPTFLS - flush an option (IP or TCP, for example) from the data stream
described by P1, P2, and P3.
* RELBIB, ARLBIB - flush a BIB and everything that has anything to do with it.
* RELBUF - subroutine to release all buffers in a stream
* RPLWRD - replace the next full 32-bit word from the data stream described
by P1, P2, and P3 by the value passed in in T1.
* SKPBYT - find the location of the Nth byte in a buffer stream.
More from NETSUB:
D IMPGTT
D IMPDAT
D MESTYP
D EPLCNT
D INCCNT
D BADIMP
D BDMLNK
D BDMMES
D BDMRFM
D NODRFM
D SIZERR
D IMPOOB
D IMPIME
D BUFERR
D BUFNUM
D BUFAVG
D SIZHST
D IPELED
D IPEPRT
D IPEVER
D IPECHK
D IPEUOP
D IPOPT
D IPFRAG
D IPFDUN
D ICMNLD
D ICMDER
D ICMCHK
D ICMUNT
D ICMTYP
D TCELED
D TCEMES
D TCECHK
D TCEPRT
D TCEDDB
D TCEITY
D TCEUOP
D TCPOPT
D TCENIT
D TCPPRT
D TCPFTS
D TCPFTU
D TCPMNW
D TCPWFT
D TCPWET
D TCPITY
D TCPOTY
Data structures.
NETDEF, NETSUB:
IMP buffers - hold various data, mostly the actual text of IMP
communications. Each is =37 words long. The number of these is =12
times the number of IMP connections, but any buffer may be used for any
connection. I don't know when they are allocated, but it appears that
this is done once when the system is loaded; then the routines BUFGET
and BUFREL (in NETSUB) manipulate a bit table to assign and release
buffers. RELBUF releases a chain of IMP buffers.
BIB - Buffer information block: used to keep track of where and why a
buffer stream exists. Four words long. MAKBIB (in NETSUB) allocates
a BIB by calling GET4WD which gets 4 words from FS, and also places
information about the current output buffer in the BIB and places it
on the retransmission queue. Released by RELBIB.
IMP DDB - information about an IMP connection. 114 words long. Contains
data about the IP level, TCP level (including the data described in RFC
793 as the Transmission Control Block - TCB), Telnet level, and TTY
crosspatch information.
IPSER:
FDB - fragmentation data block: block containing data to allow a
fragmented message to be reassembled. The length of the block,
according to the description, depends on the maximum message size that
is accepted, but the definition itself seems to allocate two words to
the bit mask, thus making =72 octets (=576 bytes) the maximum size.
Contains a pointer to the first IMP buffer with data in this packet.
FDBs are allocated by ALLFDB, which calls BUFGET (in NETSUB), which
gets one of the IMP buffers. [I think it would be better to allocate
free storage. - JJW] They are released by FLSFDB.
TCPSER:
FMB - future message block: block of information about a message whose
sequence number we are not ready to handle yet. Eight words long.
FMBs are allocated by GETFMB, which calls GET4WD with an argument of
2 to get two 4-words blocks [presumably consecutive!]. They are
released by RELFMB which calls GIV4WD to give back the core.
Potential problems.
The problems on this page all arise from places where the TOPS-10 code
defines a symbol that is already used in WAITS.
1. TOPS-10 has a DPOPJ which is
DPOPJ:: MOVEM S,DEVIOS(F) ;DEPOSIT I/O STATUS WORD IN DDB
CPOPJ:: POPJ P,
WAITS's DPOPJ (DSKSER/24P) is a lot more complicated. What to do?
Also, TOPS-10 has:
TPOPJ1::AOSA -1(P) ;RESTORE T1 THEN SKIP RETURN
TTPOPJ::POP P,T2
TPOPJ:: POP P,T1 ;RESTORE T1
POPJ P, ;AND RETURN
which conflicts with WAITS's routines of the same name. (Note that TOPS-10
saves a few words by combining things like this.)
2. NETSUB has a routine called FNDDDB, which WAITS also has (COMCSS/56P).
They are fairly different, so I would suggest renaming one of them.
3. The DEVCHR word in TOPS-10 DDBs stores different information for timeouts.
As explained in S.MAC/17P,
;BITS 7-9 ARE A CODE FOR HUNG DEVICE
; TIMEOUT. 0 MEANS DEVICE CANNOT BE HUNG
; 1-7 MEANS HUNG TIME IS 2**N-1 SECONDS
; POINTER = PDVTIM
;BITS 10-16 ARE THE COUNTDOWN TIMER
; FOR HUNG DEVICE. POINTER = PDVCNT
; TRANSITION TO ZERO MEANS DEVICE HUNG
Other information in DDBs is probably also different.
4. IMPDDB in WAITS (CACDAT/72P) points to a different data structure than IMPDDB
in TOPS-10 (IMPSER.MAC/5P). Since WAITS's is tied to the PUP DDB according
to comments in the code, perhaps the best thing to do is change what the
TOPS-10 code does. In fact, changing all of the code that references DDBs
would eliminate problem (3) as well.